#include "drawInput.h"

void DrawInput::pressedMouse(int button,int state,int x, int y)
{
Input::pressedMouse(button,state,x,y);
renderManager->actorList[1].location[0]=mouse3D[0];
renderManager->actorList[1].location[1]=mouse3D[1];
renderManager->actorList[1].location[2]=mouse3D[2]+0.01;
}

void DrawInput::moveMouse(int x, int y)
{
Input::moveMouse(x,y);
}

void DrawInput::dragMouse(int x, int y)
{
float oldLoc[3];
float newLoc[3];

Input::dragMouse(x,y);
renderManager->pick(x,y);

newLoc[0]=mouse3D[0];
newLoc[1]=mouse3D[1];
newLoc[2]=mouse3D[2]+0.1;

oldLoc[0]=renderManager->actorList[1].location[0];
oldLoc[1]=renderManager->actorList[1].location[1];
oldLoc[2]=renderManager->actorList[1].location[2];

if (newLoc[0]!=oldLoc[0] || newLoc[1]!=oldLoc[1] || newLoc[2]!=oldLoc[2])
  {
  Actor b;
  b.color[1]=0;
  b.bPickable=false;
  b.type=0;
  b.location[0]=mouse3D[0];
  b.location[1]=mouse3D[1];
  b.location[2]=mouse3D[2]+0.1;
  renderManager->actorList.push_back(b);
  }

oldLoc[0]=newLoc[0];
oldLoc[1]=newLoc[1];
oldLoc[2]=newLoc[2];

}
